package com.yonyou.crm.sact.taskcard.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonyou.crm.sact.taskcard.entity.SactTaskcardVO;
import com.yonyou.crm.sact.taskcard.rmitf.ISactTaskcardRmService;
import com.yonyou.crm.sact.taskcard.service.SactTaskcardBizServiceImpl;
import com.yonyou.crm.sys.modules.service.BiztypeBizServiceImpl;

@Service("dubboxProviderSactTaskcard")
public class SactTaskcardRmServiceImpl implements ISactTaskcardRmService {
	
	@Autowired
	private SactTaskcardBizServiceImpl bizService;
	@Autowired
	private BiztypeBizServiceImpl biztypeService;
	
	@Override
	public SactTaskcardVO insertTaskcard(SactTaskcardVO sactTaskcard) {
		return bizService.insertSactTaskcard(sactTaskcard);
	}

	@Override
	public List<SactTaskcardVO> getSactTaskcardList(Map<String, Object> condMap) {
		return bizService.getSactTaskcardList(condMap);
	}

	@Override
	public int deleteSactTaskcard(Long id) {
		return bizService.deleteSactTaskcard(id);
	}

	@Override
	public SactTaskcardVO updateSactTaskcard(SactTaskcardVO sactTaskcard) {
		bizService.updateSactTaskcard(sactTaskcard);
		bizService.getSactcardDetailById(sactTaskcard.getId());
		return bizService.getSactcardDetailById(sactTaskcard.getId());
	}

	@Override
	public List<SactTaskcardVO> deleteSactTaskcardByIDs(String[] idStrs, Map<String, Object> condMap) {
		bizService.deleteSactTaskcardByIDs(idStrs);
		List<SactTaskcardVO> taskcardList = bizService.getSactTaskcardList(condMap);
		return taskcardList;
	}

	@Override
	public SactTaskcardVO getTaskcardDetailById(Long id) {
		return bizService.getSactcardDetailById(id);
	}

	@Override
	public List<SactTaskcardVO> batchUpdateEnableState(String[] idArray,
			Integer enableState, Map<String, Object> searchMap) {
		bizService.batchUpdateEnableState(idArray, enableState);
		List<SactTaskcardVO> taskcardList = bizService.getSactTaskcardList(searchMap);
		return taskcardList;
	}

	@Override
	public Map<String, Object> getBiztypeListByModule(Long id) {
		return biztypeService.getModuleBiztypesForCurrentRole(id);
	}

}
